# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2025/3/8
desc: 
sample: 
"""
import requests

host = 'http://121.11.97.201:9088'
#session = requests.session()
def test_query():
    url = host+'/pinter/bank/api/login2'
    #userName=admin&password=1234
    data={
        'userName':'admin',
        'password':'1234'
    }
    reps = requests.post(url=url,data=data)
    token = reps.json().get('data')
    print(reps.headers)
    url =host+'/pinter/bank/api/query2?userName=admin'
    header ={
         'testfan-token':token
    }
    reps= requests.get(url=url,headers=header)
    print(reps.text)
    assert reps.status_code == 200
    assert reps.json()['code'] == '0'

if __name__ == '__main__':
    test_query()